<template>
  <div class="order">
    <div class="banner">
      <div class="info">
        <div class="info-aside">
          <div class="user-info">
            <!--<van-uploader :after-read="onRead">-->
              <img
                :src="baseInfoRow.topimg"
                alt=""
              >
            <!--</van-uploader>-->
            <div>
              <p>{{baseInfoRow.nickname}}</p>
              <!--<img-->
                <!--class="lv"-->
                <!--src="../../assets/images/user/2.png"-->
                <!--alt=""-->
              <!--&gt;-->
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="tool">
      常用工具
    </div>
    <div class="operate">
      <div @click="goUserInfo">
        <img
          src="../../assets/images/user/9.png"
          alt=""
        >
        <p>个人资料</p>
      </div>
      <div @click="goTeamList">
        <img
          src="../../assets/images/user/14.png"
          alt=""
        >
        <p>我的团队</p>
      </div>
      <div @click="goWallet">
        <img
          src="../../assets/images/user/13.png"
          alt=""
        >
        <p>账单</p>
      </div>

      <div @click="goFinancial">
        <img
          src="../../assets/images/user/1.png"
          alt=""
        >
        <p>财务管理</p>
      </div>

    </div>

    <div class="tabs-box">
      <div
        class="tabs"
        @click="goCard"
      >
        <div>

          <img
            src="../../assets/images/user/13.png"
            alt=""
          >
          <span>银行卡</span>
        </div>
        <div><i class="icon iconfont icon-xiangyou"></i></div>
      </div>
      <div class="tabs" @click="goCustomerService">
        <div>
          <img
            src="../../assets/images/user/8.png"
            alt=""
          >
          <span>客服中心</span>
        </div>
        <div><i class="icon iconfont icon-xiangyou"></i></div>
      </div>
      <!--<div class="tabs" @click="goFeedBack">-->
        <!--<div>-->
          <!--<img-->
            <!--src="../../assets/images/user/12.png"-->
            <!--alt=""-->
          <!--&gt;-->
          <!--<span>问题反馈</span>-->
        <!--</div>-->
        <!--<div><i class="icon iconfont icon-xiangyou"></i></div>-->
      <!--</div>-->
    </div>
    <div class="submit" @click="logout">
      <button>退出登录</button>
    </div>
  </div>

</template>
<script>
import { agentInfo,fileUploadOne, personalData,topimgUpdate } from "../../api/user";
import { Toast } from "vant";
// import { mapState } from 'vuex';
export default {
  data() {
    return {
      baseInfoRow:{},
    };
  },
  methods: {
    goUserInfo() {
      this.$router.push({
        path: "/userinfo"
      });
    },
    goCard() {
      this.$router.push({
        path: "/cardList"
      });
    },
    goFeedBack(){
      this.$router.push({
        path: "/feedback"
      });
    },

    // onRead(file) {
    //   let fd = new FormData();
    //   fd.append("image", file.file);
    //   fileUploadOne(fd).then(res => {
    //     if (res.status == 200) {
    //       topimgUpdate({topimg:res.data.imageurl}).then(res=> {
    //         Toast(res.message)
    //         if(res.status == 200) {
    //           this.getUserinfo();
    //         }
    //       })
    //     }
    //   });
    // },

    goTeamList() {
      this.$router.push({
        path: "/invite"
      });
    },
    goWallet() {
      this.$router.push({
        path: "/wallet"
      });
    },
    goFinancial() {
      this.$router.push({
        path: "/financial"
      });
    },
    goCustomerService(){
      this.$router.push({
        path: "/customerService"
      });
    },

    getUserinfo() {
      this.baseInfoRow = JSON.parse(localStorage.getItem('baseInfo'));
    },

    logout(){
      localStorage.removeItem('token');
      Toast("退出成功");
      setTimeout(() => {
        this.$router.push({
          path: "/login"
        });
      }, 1200);
    }
  },
  created() {
    this.getUserinfo();
  },

};
</script>

<style lang="scss">
.order {
  width: 100%;
  overflow-x: hidden;
  // height: 100%;
  background-color: #f5f5f5;

  padding-bottom: 48px;
  .banner {
    width: 100%;
    height: 100px;
    background:linear-gradient(160deg, #fd2039 20%, #f79971 80%); 
    position: relative;
    left: 0;
    background-color: #f5f5f5;
    top: 0;
    .title {
      line-height: 45px;
      color: #fff;
      font-size: 18px;
      font-family: PingFang-SC-Bold;
      font-weight: bold;
      letter-spacing: 2px;
      color: rgba(255, 255, 255, 1);
      opacity: 0.9;
      text-align: center;
    }
    .info {     
      position: absolute;
      left: 0;
      bottom: 5%;
      .info-aside {
        display: flex;
        display: -webkit-flex;
        justify-content: space-between;
        padding: 0 30px;
        align-items: center;
        transform: translateY(-10px);
        .user-info {
          display: flex;
          display: -webkit-flex;
          justify-content: space-around;
          align-items: center;
          div {
            padding-left: 10px;
            p {
              text-align: center;
              color: #fff;
              font-size: 14px;
              font-weight:400;
            }
          }
          img {
            width: 60px;
            height: 60px; 
            border-radius: 6%;
          }
          .lv {
            height: auto;
            transform: none;
            width: 38px;
          }
        }
      }
      .write {
        width: 30px;
      }
      .tips {
        padding: 10px 0;
        position: relative;
        left: 0;
        bottom: 8px;
        width: 100%;
        height: 60px;
        display: flex;
        display: -webkit-flex;
        justify-content: space-around;
        div {
          width: 33.3333%;
          height: 100%;
          display: flex;
          display: -webkit-flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          border-right: 1px solid #dedbdb;
          p {
            color: #7a7979;
            font-size: 13px;
            font-weight: 500;
          }
          p:first-child {
            font-size: 16px;
            color: #303030;
            margin-bottom: 5px;
          }
        }
        div:last-child {
          border-right: none;
        }
      }
    }
  }
  .tool {
    background-color: #fff;
    padding: 15px;
    color: rgba(43, 43, 43, 1);
    font-size: 14px;
    font-weight: bold;
  }
  .operate {
    display: flex;
    display: -webkit-flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 10px;
    background-color: #fff;
    padding: 15px 30px;
    border-top: 1px solid rgba(30, 30, 30, 0.1);
    div {
      display: flex;
      display: -webkit-flex;
      justify-content: space-around;
      align-items: center;
      flex-direction: column;
      img {
        width: 25px;
        margin-bottom: 5px;
      }
      p { 
        font-size: 14px; 
        font-weight: 400;
    }
    }
  }
  .children {
    width: 100%;
    padding: 15px;
    background-color: #fff;
    img {
      width: 100%;
    }
  }
  .header-img {
    display: flex;
    display: -webkit-flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
    .photo {
      position: relative;
      left: 0;
      top: 0;
      span {
        position: absolute;
        right: -15px;
        bottom: 6px;
        background-color: #f5c60c;
        padding: 2px;
        border-radius: 5px;
        color: #fff;
        font-size: 14px;
      }
    }
    img {
      width: 90px;
      border-radius: 50%;
    }
    p {
      padding-top: 10px;
      font-size: 14px;
      color: #fff;
      font-weight: 600;
    }
  }
  .userinfo {
    display: flex;
    display: -webkit-flex;
    justify-content: flex-start;
    align-items: center;
    padding-top: 8%;
    flex-direction: column;
    width: 100%;
    height: 240px;

    background-image: linear-gradient(
      135deg,
      rgb(253, 216, 25) 10%,
      rgb(232, 5, 5) 100%
    );
    position: relative;
    left: 0;
    top: 0;
  }
  .tabs-box {
    width: 100%;
    margin-top: 10px;
    .tabs {
      width: 100%;
      height: 48px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      padding: 0 15px;
      background-color: #fff;
      border-bottom: 1px solid #eee;
      img {
        vertical-align: middle;
        width: 20px;
      }
      span {
        vertical-align: middle;
        padding-left: 10px;
        font-size: 14px;
      }
    }
    div:nth-child(2),
    div:nth-child(5),
    div:nth-child(7),
    div:nth-child(9) {
      margin-bottom: 10px;
    }
  }
  .submit {
    width: 100%;
    text-align: center;
    padding: 20px 0;

    button {
      width: 90%;
      height: 40px;
      outline: none;
      border: none;
      background-color: #e71434;
      font-size: 16px;
      color: #fff;
      border-radius: 5px;
    }
  }
}
</style>


